package com.senmiao.ssm.util;

import lombok.Data;

@Data
public class Result<T> {

    private int code;
    private String msg;
    private T data;

    public Result ok(){
        this.code = 200;
        return this;
    }

    public Result code(int code){
        this.code = code;
        return this;
    }

    public Result error(){
        this.code = 500;
        return this;
    }

    public Result msg(String msg){
        this.msg = msg;
        return this;
    }

    public Result data(T data){
        this.data = data;
        return this;
    }

}
